unicode-bom
Unicode byte-order mark detection for Rust projects.
- What does it do?
- What doesn't it do?
- How do I install it?
- How do I use it?
- How do I set up the build environment?
- Is there API documentation?
- Is there a change log?
- What license is it published under?
What does it do?
unicode-bom
will read
the first few bytes from
an array or a file on disk,
then determine whether
a byte-order mark is present.
What doesn't it do?
It won't check the rest of the data to determine whether it's actually valid according to the indicated encoding.
How do I install it?
Add it to your dependencies
in Cargo.toml
:
[]
= "2"
How do I use it?
For more detailed information see the API docs, but the general gist is as follows:
use Bom;
// The BOM can be parsed from a file on disk via the `FromStr` trait...
let bom: Bom = "foo.txt".parse.unwrap;
match bom
// ...or you can detect the BOM in a byte array
let bytes = ;
let bom = from;
assert_eq!;
assert_eq;
How do I set up the build environment?
If you don't already have Rust installed,
get that first using rustup
:
curl https://sh.rustup.rs -sSf | sh
Then you can build the project:
cargo b
And run the tests:
cargo t
Is there API documentation?
Yes.
Is there a change log?
Yes.